package Test3;

public class Phone {
    //私有属性
    private  String brand;
    private int price;

    //空参
    public Phone(){};
//有参构造
public Phone (String brand, int price) {
    this.brand = brand;
    this.price = price;
    }
    public String getBrand() {
        return brand;
    }
    public void setBrand(String brand) {
        this.brand = brand;
    }
    public int getPrice() {
        return price;
    }
    public void setPrice(int price) {
        this.price = price;//this price本身的price 外部传进来的price
    }
    public void call() {
        System.out.println("正在使用价格为" + price + "元的" + brand + "品牌的手机打电话....");
    }

    // 行为：发短信
    public void sendMessage() {
        System.out.println("正在使用价格为" + price + "元的" + brand + "品牌的手机发短信....");
    }

    // 行为：玩游戏
    public void playGame() {
        System.out.println("正在使用价格为" + price + "元的" + brand + "品牌的手机玩游戏....");
    }
    
}
